﻿using System;
using System.Data;
using System.Collections.Generic;
using BOMS.Model;
namespace BOMS.BLL
{
    /// <summary>
    /// 业务逻辑类S_BatgrpSubLog 的摘要说明。
    /// </summary>
    public class S_BatgrpSubLog
    {
        private readonly BOMS.DAL.S_BatgrpSubLog dal = new BOMS.DAL.S_BatgrpSubLog();
        public S_BatgrpSubLog()
        { }
        #region  成员方法
      
      
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<BOMS.Model.S_BatgrpSubLog> DataTableToList(DataTable dt)
        {
            List<BOMS.Model.S_BatgrpSubLog> modelList = new List<BOMS.Model.S_BatgrpSubLog>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                BOMS.Model.S_BatgrpSubLog model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BOMS.Model.S_BatgrpSubLog();
                    dal.AssignModel(dt.Rows[n], model);
                    modelList.Add(model);
                }
            }
            return modelList;
        }

        
        /// <summary>
        /// 分页，获得数据列表
        /// </summary>
        public List<BOMS.Model.S_BatgrpSubLog> GetModelListFromPage(string strWhere, string strOrderby, int pageSize, int curPage, out int recordCount)
        {
            DataSet ds = dal.GetListFromPage(strWhere, strOrderby, pageSize, curPage, out recordCount);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}

